Combining Kanzi Studio projects into a Kanzi application
You can combine the content of several Kanzi Studio projects into a single Kanzi application. This enables you to:
- Distribute Kanzi application development across several teams. Each team can work on a different part of the same application at the same time.
- Include in your Kanzi applications content available only in kzb files.
- Use Kanzi Studio projects which only hold resources you want to use in multiple projects.
- Simplify the structure of your Kanzi application by splitting it into several Kanzi Studio projects.
For example, when you are developing an in-vehicle infotainment application consisting of several applications, you can develop each of these applications in one or more Kanzi Studio projects. You then use one Kanzi application to combine these Kanzi Studio projects into a single Kanzi application.
To combine Kanzi Studio projects into a single Kanzi application:
To use theming and localization when you combine multiple Kanzi Studio projects into a Kanzi application, you must make the theme groups and localization tables accessible to the Screen node of the main project of your application. See Using theming and localization in multiple Kanzi Studio projects combined into a Kanzi application.
Learn how to combine content from Kanzi Studio projects by completing a tutorial. See Tutorial: Combine Kanzi Studio projects into a single Kanzi application.
Kanzi Studio solution structure
A Kanzi Studio solution is a Kanzi Studio project which you use to combine Kanzi applications into a single Kanzi application.
When you create a Kanzi solution, use these guidelines:
When you add Kanzi Studio projects to a Kanzi solution, use these guidelines:
Using prefabs and resources from Kanzi Studio projects
To use prefabs and resources from Kanzi Studio projects:
- Open or create a Kanzi Studio project in which you want to use content from other Kanzi Studio projects.
From here on this project is referred to as the referencing project.
- In the Library press Alt and right-click Project References, select Existing Project, select a Kanzi Studio project from which you want to use content in the referencing project, and click Open.
Kanzi Studio loads the project in a new tab. If that project contains project references, Kanzi Studio loads the projects to which the references point.
From here on these projects are referred to as the referenced projects.
In the project tabs the Preview icon marks the project which is active in the Preview.
TIPTo view a project in the Preview, in the project tab right-click the tab of that project and select Show in Preview.
TIPThe order of project references in the Library > Project References determines the order in which Kanzi loads the kzb files of the projects when you run your application.
- In the Preview click Restart and in the Kzb export dialog click Yes to export the kzb files of the referenced projects.
Kanzi Studio creates the kzb file and configuration files from the referenced projects.
This way you make the content of the referenced projects available to the Preview of the referencing project.
TIPBy default when you start or restart the Preview Kanzi Studio asks whether you want to export the kzb files of the referenced projects. To set Kanzi Studio to always export the kzb files without asking, either:
- In the Kzb export dialog enable the Do not ask me again option and click Yes.
- Select > User Preferences and in the Advanced tab set the value of the Referenced project kzb file export behavior setting to Always export.
TIPWhen the project that Kanzi Studio shows in the Preview or any of the referenced projects contain changes that you have not yet exported to the kzb files of the projects, in the Preview the Restart button is orange.
To see the projects whose content in the Preview is outdated, hover over the button.
- In the project tab bar select the referenced project from which you want to use a prefab or resource.
- To make prefabs and resources available in Kanzi Studio in the dropdown menus of the referencing project either:
- Use the content from the referenced project:
- To use a prefab, in the Project create either a Prefab Placeholder or a Prefab View node where you want to use the prefab, and in the Properties set the Prefab Template property to the prefab which you made available in the previous step.
Kanzi Studio automatically sets the Prefab Template property to use the kzb URL of the prefab.
You can control prefabs from referenced projects. See Customizing and controlling prefabs from Kanzi Studio projects.
- To use a resource, in the Project select the node where you want to use the resource and in the Properties set the property where you want to use the resource to the resource which you made available in the previous step.
Kanzi Studio automatically sets the property to use the kzb URL of the resource.
- (Optional) Customize and control the appearance of prefabs. See Customizing and controlling prefabs from Kanzi Studio projects.
Using prefabs and resources from kzb files
To use prefabs and resources from kzb files:
- Open or create a Kanzi Studio project in which you want to use content from a kzb file.
- In the Library press Alt and right-click Project References, select Existing .kzb, select a kzb file from which you want to use content in the target project, and click Open.
If the kzb file refers to other kzb files, you must also add the references to those kzb files.
- Use content from the kzb file:
- To use a prefab, in the Project create either a Prefab Placeholder or a Prefab View node where you want to use the prefab, in the Properties set the Prefab Template property to <ResourceID>, and enter the kzb URL of the prefab you want to use.
- To use a resource, in the Project select the node where you want to use the resource, in the Properties set the property where you want to use the resource to <ResourceID>, and enter the kzb file URL of the resource you want to use.
Customizing and controlling prefabs from Kanzi Studio projects
In a Kanzi solution when you use prefabs from a Kanzi Studio project, you can set the content and appearance of these prefabs. You can do this by using a property type in the root node of each prefab which you bind to the prefab content that you want to control.
To control prefabs from Kanzi Studio projects:
- Open or create a project and add to that project a prefab from a Kanzi Studio project. See Using prefabs and resources from Kanzi Studio projects.
From here on this project is referred to as the target project.
- In the project tab bar select the project which contains the prefab that you want to control, in the Prefabs select the prefab, and in the Properties next to the property with which you want to control the prefab click .
Kanzi Studio creates from that property a custom property, adds it to the root of the prefab, and creates a ##Template
binding to the property in the prefab root. This enables you to edit the appearance of the prefab from the root of the prefab.
For example, if you want to control the progress bar of a music player using a property called Progress, click next to that property.
From here on this project is referred to as the source project.
- In the Preview click to restart the Preview, and export the kzb file of the source project.
- In the project tab bar select the target project, in the Project select the node you use to instantiate the prefab from the source project that you want to control, and in the Properties add the custom property you created in the previous step.
You can now use the property in the target project to control the prefab from the source project.
Merging content from referenced Kanzi Studio projects
When you want to bring content from referenced Kanzi Studio projects you can merge the items you need.
To merge content from referenced Kanzi Studio projects, in the Library > Project References right-click the source project from which you want to bring content and select Merge Project.
Merge Project allows you to import only the selected items to the target project. When merging you can select which project items you want to import and resolve conflicts for items that exist in both projects. Kanzi Studio merges nodes from the source project to a new prefab. Kanzi Studio creates the nodes and resources even if they exist in the target project and you have not merged it before from the same project reference (in which case it is marked as identical). See Merging projects.
Loading projects that refer to the same referenced project
Kanzi Studio does not support loading of the same project in multiple instances of Kanzi Studio. In the Library Kanzi Studio marks with red type project references that are already loaded in another instance of Kanzi Studio. If the kzb file of that project exists, the Kanzi Studio Preview shows the content of that kzb file. If you unload a referenced project, the Preview does not show the content of that project.
When you want to load a Kanzi Studio project as a project reference in multiple Kanzi Studio projects, make those projects part of the same Kanzi Studio solution.
For example, if you have Kanzi Studio solutions named MainProject1 and MainProject2, which both contain a project reference to the Resources project:
- Create a Kanzi Studio project.
- In the Library > Project References create project references for the MainProject1 and MainProject2 Kanzi Studio projects.
You can now use the same instance of Kanzi Studio to edit the MainProject1, MainProject2, and Resources projects.
Using theming and localization in multiple Kanzi Studio projects combined into a Kanzi application
To use theming and localization when you combine multiple Kanzi Studio projects into a Kanzi application, you must make the theme groups and localization tables accessible to the Screen node of the main project of your application in one of these ways:
- Define the theme groups and localization tables in the main project of your application.
- Merge the theme groups and localization tables from referenced projects to the main project which contains the Screen node. You can then use resource IDs to access the resources in the theme groups and localization tables from the referenced projects. See Merging projects.
- Contact the Rightware support team and request the Kanzi Engine plugins which enable you to use theming and localization across multiple Kanzi Studio projects and kzb files. See Submitting a support request.
See also
Tutorial: Combine Kanzi Studio projects into a single Kanzi application
Importing projects
Merging projects
Using prefabs
Theming your applications
Localization
Open topic with navigation